<%@ page language="java" contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<c:set var="path" value="${pageContext.request.contextPath }"></c:set>
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>HHM-采集指标</title>
    <link href="${path}/css/style.css" rel="stylesheet" type="text/css">
    <link href="${path}/common/plugins/bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css">
    <link href="${path}/common/plugins/zTree/css/zTreeStyle/zTreeStyle.css" rel="stylesheet" type="text/css">
    <script src="${path}/js/jquery-1.7.2.min.js" type="text/javascript"></script>
    <script src="${path}/common/plugins/handlebars.js" type="text/javascript"></script>
    <script src="${path}/common/plugins/zTree/jquery.ztree.all-3.5.min.js"></script>
    <script src="${path}/common/plugins/bootstrap/js/bootstrap.js" type="text/javascript"></script>
    <script src="${path}/common/plugins/layer/layer.js"></script>
    <script src="${path}/js/common.js" type="text/javascript"></script>
    <script src="collectionIndicator.js" type="text/javascript"></script>
</head>
<script type="application/javascript">
    var basePath="${path}";
    var resourceId="${data.resourceId}";
</script>
<body>
    <div class="content">
        <div class="control-title">
            <i class="content_current"></i><span>采集监控项</span><span>IP地址:${data.manageIp}</span>
        </div>
        <div class="content-table">
            <!-- Nav tabs -->
            <ul class="nav nav-tabs" role="tablist">
                <li role="presentation" class="active">
                    <a href="#cfg" aria-controls="cfg" role="tab" data-toggle="tab">配置</a>
                </li>
                <li role="presentation">
                    <a href="#capac" aria-controls="capac" role="tab" data-toggle="tab">容量</a>
                </li>
                <li role="presentation">
                    <a href="#perf" aria-controls="pref" role="tab" data-toggle="tab">性能</a>
                </li>

                <li role="presentation">
                    <a href="#sysservice" aria-controls="process" role="tab" data-toggle="tab">系统服务</a>
                </li>
                <li role="presentation">
                    <a href="#sysprocess" aria-controls="status" role="tab" data-toggle="tab">系统进程</a>
                </li>
                <li class="btn btn-small btn-success" title="一键采集时，页面不能点击，且等待时间较长！" style="float: right;">
                    <span id="allCollection" >一键采集</span>
                </li>
            </ul>
            <!-- Tab panes -->
            <div class="tab-content"><div role="tabpanel" class="tab-pane active" id="cfg">
                <div class="row-fluid">
                    <div class="span4">
                        <a class="btn btn-small btn-success" type="button" indtype="cfg">采集</a>
                    </div>
                </div>
                <div class="row-fluid">
                    <div class="ztree" id="cfg_ztree" >

                    </div>
                    <br/>
                    <br/>
                </div>
                <div class="btn_bottom">
                    <div class="spanbtn">
                        <button class="press_btn1 treeSave"><i class="save top_current"></i>保存</button>
                        <button class="press_btn2 Close"><i class="del top_current"></i>关闭</button>
                    </div>
                </div>
            </div>
                <div role="tabpanel" class="tab-pane" id="perf">
                    <div class="row-fluid">
                        <div class="span4">
                            <a class="btn btn-small btn-success" type="button" indtype="perf">采集</a>
                        </div>
                    </div>
                    <div class="row-fluid">
                        <div class="ztree" id="perf_ztree">

                        </div>
                        <br/>
                        <br/>
                    </div>
                    <div class="btn_bottom">
                        <div class="spanbtn">
                            <button class="press_btn1 treeSave"><i class="save top_current"></i>下一步</button>
                            <button class="press_btn2 Close"><i class="del top_current"></i>关闭</button>
                        </div>
                    </div>
                </div>
                <div role="tabpanel" class="tab-pane" id="capac">
                    <div class="row-fluid">
                        <div class="span4">
                            <a class="btn btn-small btn-success" type="button" indtype="capac">采集</a>
                        </div>
                    </div>
                    <div class="row-fluid">
                        <div class="ztree" id="capac_ztree">

                        </div>
                        <br/>
                        <br/>
                    </div>
                    <div class="btn_bottom">
                        <div class="spanbtn">
                            <button class="press_btn1 treeSave"><i class="save top_current"></i>下一步</button>
                            <button class="press_btn2 Close"><i class="del top_current"></i>关闭</button>
                        </div>
                    </div>
                </div>
                <div role="tabpanel" class="tab-pane" id="sysservice">
                    <div class="row-fluid">
                        <div class="span4">
                            <a class="btn btn-small btn-success" type="button" indtype="service">采集</a>
                        </div>
                    </div>
                    <div class="row-fluid">
                        <div id="service">

                        </div>
                        <br/>
                        <br/>
                    </div>
                    <div class="btn_bottom">
                        <div class="spanbtn">
                            <button class="press_btn1 Save"><i class="save top_current"></i>保存</button>
                            <button class="press_btn2 Close"><i class="del top_current"></i>关闭</button>
                        </div>
                    </div>
                </div>
                <div role="tabpanel" class="tab-pane" id="sysprocess">
                    <div class="row-fluid">
                        <div class="span4">
                            <a class="btn btn-small btn-success" type="button" indtype="process">采集</a>
                        </div>
                    </div>
                    <div class="row-fluid">
                        <div id="process">

                        </div>
                        <br/>
                        <br/>
                    </div>
                    <div class="btn_bottom">
                        <div class="spanbtn">
                            <button class="press_btn1 Save"><i class="save top_current"></i>下一步</button>
                            <button class="press_btn2 Close"><i class="del top_current"></i>关闭</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

<%--<div class="btn_bottom">--%>
    <%--<div class="spanbtn">--%>
        <%--<button class="press_btn1 Save"><i class="save top_current"></i>下一步</button>--%>
        <%--<button class="press_btn2 Close"><i class="del top_current"></i>关闭</button>--%>
    <%--</div>--%>
<%--</div>--%>

</body>

</html>
<script id="service-template" type="text/x-handlebars-template">
    <div class="content_table">
            <table class="table table-striped table-bordered table-hover table-ellipsis details">
            <thead>
            <tr>
            <th class="checkwidth"><input type="checkbox" class="checkAll" title="全选"/></th>
            <th>名称</th>
            <th>状态</th>
            </tr>
            </thead>
                <tbody>
                {{#each data}}
                <tr id="serviceId_{{monitorServiceIndicatorId}}">
                    <td class="checkNot"><input type="checkbox" class="checkinput" name="monitor" {{selectcheckbox monitorFlag}}/></td>
                    <td>{{serviceName}}</td>
                    <td>{{serviceState}}</td>
                </tr>
                {{/each}}
                </tbody>
            </table>
        </div>
</script>

<script id="service-template" type="text/x-handlebars-template">
    <div class="content_detail">
        <div class="control-title">
            <i class="user_manage content_current"></i><span>告警级别设置--容量</span>
        </div>
        <div class="content_condition">
            <div class="content_title">磁盘使用大小</div>
            <div class="content_group">
                <div class="span12 group">
                    <label class="control-label">warning:</label>
                    <div class="rowbox">
                        <div class="row-fluid">
                            <div class="span12">
                                <label class="control-label" style="width:150px;">warning:</label>
                                <div class="controls">
                                    阀值范围
                                    (<input type="text" id="service_warning_from_default" onblur="volidateRange(this)" class="input-mini offset-mini" placeholder="30"/>
                                    ~<input type="text" id="service_warning_to_default" onblur="volidateRange(this)" class="input-mini offset-mini" placeholder="50"/>)
                                </div>
                            </div>
                        </div>
                        <div class="row-fluid" style="margin-top: 10px;">
                            <div class="span12">
                                <label class="control-label" style="width:150px;">error:</label>
                                <div class="controls">
                                    阀值范围
                                    (<input type="text" id="service_error_from_default" onblur="volidateRange(this)" class="input-mini offset-mini" placeholder="30"/>
                                    ~<input type="text" id="service_error_to_default" onblur="volidateRange(this)" class="input-mini offset-mini" placeholder="50"/>)
                                </div>
                            </div>
                        </div>
                        <div class="row-fluid" style="margin-top: 10px;">
                            <div class="span12">
                                <label class="control-label" style="width:150px;">critical:</label>
                                <div class="controls">
                                    阀值范围
                                    (<input type="text" id="service_critical_from_default" onblur="volidateRange(this)" class="input-mini offset-mini" placeholder="30"/>
                                    ~<input type="text" id="service_critical_to_default" onblur="volidateRange(this)"  class="input-mini offset-mini" placeholder="50"/>)
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</script>

<script id="capac-template" type="text/x-handlebars-template">
            <div class="content_group" id="{{thresholdCapacId}}">
                <div class="span12 group">
                    <label class="control-label">{{pi_id}}({{pi_name}})</label>
                    <div class="rowbox">
                        <div class="row-fluid">
                            <div class="span12">
                                <label class="control-label" style="width:150px;">warning:</label>
                                <div class="controls">
                                    阀值范围
                                    (<input type="text" id="capac_warning_from_default" onblur="volidateRange(this)" class="input-mini offset-mini" name="waringFrom" value="{{waringFrom}}"/>
                                    ~<input type="text" id="capac_warning_to_default" onblur="volidateRange(this)" class="input-mini offset-mini" name="waringTo" value="{{waringTo}}"/>)
                                </div>
                            </div>
                        </div>
                        <div class="row-fluid" style="margin-top: 10px;">
                            <div class="span12">
                                <label class="control-label" style="width:150px;">error:</label>
                                <div class="controls">
                                    阀值范围
                                    (<input type="text" id="capac_error_from_default" onblur="volidateRange(this)" class="input-mini offset-mini" name="errorFrom" value="{{errorFrom}}"/>
                                    ~<input type="text" id="capac_error_to_default" onblur="volidateRange(this)" class="input-mini offset-mini" name="errorTo" value="{{errorTo}}"/>)
                                </div>
                            </div>
                        </div>
                        <div class="row-fluid" style="margin-top: 10px;">
                            <div class="span12">
                                <label class="control-label" style="width:150px;">critical:</label>
                                <div class="controls">
                                    阀值范围
                                    (<input type="text" id="capac_critical_from_default" onblur="volidateRange(this)" class="input-mini offset-mini" name="criticalFrom" value="{{criticalFrom}}"/>
                                    ~<input type="text" id="capac_critical_to_default" onblur="volidateRange(this)" class="input-mini offset-mini" name="criticalTo" value="{{criticalTo}}"/>)
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
</script>

<script id="perf-template" type="text/x-handlebars-template">
    <div class="content_group" id="{{thresholdPerfId}}">
        <div class="span12 group">
            <label class="control-label">{{pi_id}}({{pi_name}})</label>
            <div class="rowbox">
                <div class="row-fluid">
                    <div class="span12">
                        <label class="control-label" style="width:150px;">warning:</label>
                        <div class="controls">
                            在<input type="text" class="input-mini offset-mini" name="warningInterval" value="{{warningInterval}}"/>
                            分钟内超过<input type="text" class="input-mini offset-mini"  name="warningCounts" value="{{warningCounts}}"/>
                            次告警&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;阀值范围
                            (<input type="text" id="perf_warning_from_default" onblur="volidateRange(this)" class="input-mini offset-mini" name="waringFrom" value="{{waringFrom}}"/>
                            ~<input type="text" id="perf_warning_to_default" onblur="volidateRange(this)" class="input-mini offset-mini" name="waringTo" value="{{waringTo}}"/>)
                        </div>
                    </div>
                </div>
                <div class="row-fluid" style="margin-top: 10px;">
                    <div class="span12">
                        <label class="control-label" style="width:150px;">error:</label>
                        <div class="controls">
                            在<input type="text" class="input-mini offset-mini" name="errorInterval" value="{{errorInterval}}"/>
                            分钟内超过<input type="text" class="input-mini offset-mini" name="errorCounts" value="{{errorCounts}}"/>
                            次告警&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;阀值范围
                            (<input type="text" id="perf_error_from_default" onblur="volidateRange(this)" class="input-mini offset-mini" name="errorFrom" value="{{errorFrom}}"/>
                            ~<input type="text" id="perf_error_to_default" onblur="volidateRange(this)" class="input-mini offset-mini" name="errorTo" value="{{errorTo}}"/>)
                        </div>
                    </div>
                </div>
                <div class="row-fluid" style="margin-top: 10px;">
                    <div class="span12">
                        <label class="control-label" style="width:150px;">critical:</label>
                        <div class="controls">
                            在<input type="text" class="input-mini offset-mini" name="criticalInterval" value="{{criticalInterval}}"/>
                            分钟内超过<input type="text" class="input-mini offset-mini" name="criticalCounts" value="{{criticalCounts}}"/>
                            次告警&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;阀值范围
                            (<input type="text" id="perf_critical_from_default" onblur="volidateRange(this)" class="input-mini offset-mini" name="criticalFrom" value="{{criticalFrom}}"/>
                            ~<input type="text" id="perf_critical_to_default" onblur="volidateRange(this)" class="input-mini offset-mini" name="criticalTo" value="{{criticalTo}}"/>)
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</script>

<script id="process-template" type="text/x-handlebars-template">
    <div class="content_group" id="{{thresholdProgressId}}">
        <div class="span12 group">
            <label class="control-label">{{indicator_name}}({{indicator_bcode}})</label>
            <div class="rowbox">
                <div class="row-fluid">
                    <div class="span12">
                        <label class="control-label" style="width:150px;">warning:</label>
                        <div class="controls">
                            在<input type="text" class="input-mini offset-mini" name="warningInterval" value="{{warningInterval}}"/>
                            分钟内超过<input type="text" class="input-mini offset-mini"  name="warningCounts" value="{{warningCounts}}"/>
                            次告警&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;阀值范围
                            (<input type="text" id="proc_warning_from_default" onblur="volidateRange(this)" class="input-mini offset-mini" name="waringFrom" value="{{waringFrom}}"/>
                            ~<input type="text" id="proc_warning_to_default" onblur="volidateRange(this)" class="input-mini offset-mini" name="waringTo" value="{{waringTo}}"/>)
                        </div>
                    </div>
                </div>
                <div class="row-fluid" style="margin-top: 10px;">
                    <div class="span12">
                        <label class="control-label" style="width:150px;">error:</label>
                        <div class="controls">
                            在<input type="text" class="input-mini offset-mini" name="errorInterval" value="{{errorInterval}}"/>
                            分钟内超过<input type="text" class="input-mini offset-mini" name="errorCounts" value="{{errorCounts}}"/>
                            次告警&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;阀值范围
                            (<input type="text" id="proc_error_from_default" onblur="volidateRange(this)" class="input-mini offset-mini" name="errorFrom" value="{{errorFrom}}"/>
                            ~<input type="text" id="proc_error_to_default" onblur="volidateRange(this)" class="input-mini offset-mini" name="errorTo" value="{{errorTo}}"/>)
                        </div>
                    </div>
                </div>
                <div class="row-fluid" style="margin-top: 10px;">
                    <div class="span12">
                        <label class="control-label" style="width:150px;">critical:</label>
                        <div class="controls">
                            在<input type="text" class="input-mini offset-mini" name="criticalInterval" value="{{criticalInterval}}"/>
                            分钟内超过<input type="text" class="input-mini offset-mini" name="criticalCounts" value="{{criticalCounts}}"/>
                            次告警&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;阀值范围
                            (<input type="text" id="proc_critical_from_default" onblur="volidateRange(this)" class="input-mini offset-mini" name="criticalFrom" value="{{criticalFrom}}"/>
                            ~<input type="text" id="proc_critical_to_default" onblur="volidateRange(this)" class="input-mini offset-mini" name="criticalTo" value="{{criticalTo}}"/>)
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</script>

